package com.lv.utils.mapper;

import com.lv.utils.pojo.Cron;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CronMysqlMapper {

    Cron getCron();

    @Select("select count(1) from cron where status = 1")
    int getStatusIsAllOpen();

    @Select("select cron from cron where status = 1")
    String getOpenConfigExpression();

    @Insert("insert into cron(cron,status,description) values(#{data.cron},#{data.status},#{data.description})")
    int insertCron(@Param("data") Cron data);

    int updateStatus(@Param("data") Cron data);

    @Update("update cron set status = 2")
    int stopAllCron();
}